exports.__esModule = true;

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }

exports.default = class extends think.BaseController {
    //新建任务接口

    newTaskAction() {
        var _this = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const data = _this.post(); //新建任务参数
            const taskService = _this.service('api/office/OfficeService');

            const DATA = taskService.newTask(data);
            if (!DATA.error) {
                aj.result = DATA;
            } else {
                aj.success = false;
                aj.msg = '新建任务失败';
            }
            return _this.json(aj);
        })();
    }

    //待办任务查询接口

    pendingTaskAction() {
        var _this2 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const data = _this2.get('page', 'pageSize', 'type');
            const pendingTaskService = _this2.service('api/office/OfficeService');
            const DATA = pendingTaskService.pendingTaskList(data);
        })();
    }
};